﻿namespace AspnetUtil.Util
{
    /// <summary>
    /// 字符串工具类
    /// </summary>
    public static class StrUtil
    {
        public static bool IsEmpty(string sequence)
        {
            return sequence is null or "";
        }

        public static bool IsNotEmpty(string sequence)
        {
            return !IsEmpty(sequence);
        }

        /// <summary>
        /// 判断字符串是否为空
        /// </summary>
        /// <param name="sequence"></param>
        /// <returns></returns>
        public static bool IsBlank(string sequence)
        {
            return null == sequence || "".Equals(sequence.Trim());
        }

        /// <summary>
        /// 判断字符串不为空
        /// </summary>
        /// <param name="sequence"></param>
        /// <returns></returns>
        public static bool IsNotBlank(string sequence)
        {
            return !IsBlank(sequence);
        }
    }
}